using System;
using System.Web.UI;

using LocalBoard.Controller;

namespace LocalBoard.Web
{
	/// <summary>
	/// Summary description for SeeBoard.
	/// </summary>
	public partial class SeeBoard : BoardPage
	{
		//System.Web.UI.WebControls.Repeater loadedContent;

		protected void Page_Load(object sender, EventArgs e)
		{
			if(GetCurrentBoardId() == 0)
				Security.RedirectToHome();
            //boardName.Text = CurrentBoard.Name;
			if(!BoardController.GetBoardSecurity().CanUserAccessBoard(this.ClubUser))
				throw new ApplicationException("You are not authorized to view the board.");
            //if(ShouldHideMessageViewControl())
            //    messageView.Visible = false;
			this.loadedContent.DataSource = BoardController.GetMessageListForCurrentPage();
			this.loadedContent.DataBind();
		}

		private bool ShouldHideMessageViewControl()
		{
            return false;// messageView.GetMessageId() == 0 && messageView.GetReplyToMessageId() == 0 && messageView.GetMessageViewMode().Length == 0;
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{

		}
		#endregion
}
}